<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bad_result_access_with&lt;EC&gt; - Boost.Outcome documentation</title>
<link rel="stylesheet" href="../../css/boost.css" type="text/css">
<meta name="generator" content="Hugo 0.52 with Boostdoc theme">
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>

<link rel="icon" href="../../images/favicon.ico" type="image/ico"/>
<body><div class="spirit-nav">
<a accesskey="p" href="../../reference/types/bad_outcome_access.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/types.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/types/bad_result_access.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  <div class="titlepage"><div><div><h1 style="clear: both"><code>bad_result_access_with&lt;EC&gt;</code></h1></div></div></div>
  <p>Exception type publicly inheriting from <a href="../../reference/types/bad_result_access.html" class="api-reference"><code>bad_result_access</code></a>
, and thus also 
<a href="https://en.cppreference.com/w/cpp/error/logic_error" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> <code>std::logic_error</code></a>
, indicating an incorrect observation of value occurred. The error value at the time of the exception throw is moved or copied into this type, and is available using the <code>.error()</code> observer which comes in lvalue ref, const lvalue ref, rvalue ref, and const rvalue ref overloads.</p>

<p>The primary purpose of this exception type is to enable standing in for 
<a href="https://wg21.link/P0323" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> P0323 <code>std::expected&lt;T, E&gt;</code></a>
&rsquo;s <code>bad_expected_access&lt;E&gt;</code> which is thrown on incorrect wide value observation. This is why it is only ever <code>EC</code> which is thrown with <code>bad_result_access_with&lt;EC&gt;</code> on value observation only, and only when there is an error available. See the <a href="../../reference/policies/throw_bad_result_access.html" class="api-reference"><code>throw_bad_result_access&lt;EC&gt;</code></a>
 policy for more information.</p>

<p><em>Requires</em>: Nothing.</p>

<p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE</code></p>

<p><em>Header</em>: <code>&lt;boost/outcome/bad_access.hpp&gt;</code></p>


        </div><p><small>Last revised: January 25, 2019 at 01:51:37 UTC</small></p>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../reference/types/bad_outcome_access.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/types.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/types/bad_result_access.html"><img src="../../images/next.png" alt="Next"></a></div></body>
</html>
